package com.doit.day03

import scala.collection.mutable.ListBuffer


object _05_集合 {
  def main(args: Array[String]): Unit = {
    //语法
    val list: List[Int] = List(1, 2, 3, 4, 5)
    val list1: List[Int] = 1 :: 2 :: 3 :: 4 :: 5 :: Nil
    //空集合  Nil=List(4,3,2,1)
    val list2: List[Int] = Nil.::(5).::(4).::(3).::(2)
    println(list1)//List(1, 2, 3, 4, 5)
    println(list2)//List(4, 3, 2, 1)

    println(list)//List(1, 2, 3, 4, 5)

    println(list(1))//2

    //++:
    val ints: List[Int] = list.:::(list2)
    println(ints)

    //可变集合
    val ints1: ListBuffer[Int] = new ListBuffer[Int]()








  }
}
